package com.qingcheng.dao;

import com.qingcheng.pojo.system.Resource;
import com.qingcheng.pojo.system.RoleResource;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface RoleResourceMapper extends Mapper<RoleResource> {
    @Select("SELECT id,res_key resKey,res_name resName,parent_id parentId FROM tb_resource WHERE id IN (SELECT resource_id FROM tb_role_resource WHERE role_id=#{id})")
    public List<Resource> findListById(@Param("id") Integer id);
}
